package com.mysoft.gfyx.marketdevelop.controller;

import com.mysoft.framework.rpc.annotation.PubAction;
import com.mysoft.framework.rpc.annotation.PubService;
import com.mysoft.framework.rpc.contants.RequestPrefix;
import com.mysoft.gfyx.marketdevelop.controller.dto.ClearCacheRequestDto;
import com.mysoft.gfyx.marketdevelop.mip.dto.SearchDeveloperRequestDto;
import com.mysoft.gfyx.marketdevelop.service.MaintainanceService;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMethod;

@PubService(value = "/cacheDataApi", prefix = RequestPrefix.API)
@Tag(name = "缓存管理-API")
public class CacheDataApiController {

    @Autowired
    private MaintainanceService maintainanceService;

    @PubAction(value = "/clearCache", method = RequestMethod.POST)
    public Object clear(@RequestBody ClearCacheRequestDto dto) {
        return maintainanceService.clearCache(dto.getCacheKey());
    }

}
